import Vue from 'vue'
import Router from 'vue-router'
// import home from '../components/home/home.vue'
// import login from '../components/login/login.vue'
// import flights from '../components/flights/flights.vue'
// import forgetPd from '../components/forgetPd/forgetPd.vue'
// import register from '../components/register/register.vue'
// import fastLogin from '../components/fastLogin/fastLogin.vue'
// import userInfo from '../components/userInfo/userInfo.vue'
// import userModify from '../components/userModify/userModify.vue'
// import calendar from '../components/calendar/calendar.vue'
// console.log(home);
const router = [ // 配置各接口路径
  { // 默认路径
    path: '/',
    // component: {
    component: resolve => void (require(['../components/home/home.vue'], resolve))
    // }
    // component: home
  },
  { // 机票列表
    path: '/airTicketBookingResult',
    component: resolve => void (require(['../components/flights/airTicketBookingResult.vue'], resolve))
    // component: flights
  },
  { // 机票信息
    path: '/airTicketOrder',
    component: resolve => void (require(['../components/flights/airTicketOrder.vue'], resolve))
    // component: flights
  },
  { // 购票起始路径
    path: '/flights',
    component: resolve => void (require(['../components/flights/flights.vue'], resolve))
    // component: flights
  },
  { // 我的页面
    path: '/home',
    // component: home
    component: resolve => void (require(['../components/home/home.vue'], resolve))
  },
  {
    path: '/login',
    // component: login
    component: resolve => void (require(['../components/login/login.vue'], resolve))
  },
  {
    path: '/forgetPd',
    // component: forgetPd
    component: resolve => void (require(['../components/forgetPd/forgetPd.vue'], resolve))
  },
  {
    path: '/register',
    // component: register
    component: resolve => void (require(['../components/register/register.vue'], resolve))
  },
  {
    path: '/findPassword',
    // component: login
    component: resolve => void (require(['../components/findPassword/findPassword.vue'], resolve))
  },
  {
    path: '/fastLogin',
    // component: fastLogin
    component: resolve => void (require(['../components/fastLogin/fastLogin.vue'], resolve))
  },
  {
    path: '/userInfo',
    // component: userInfo
    component: resolve => void (require(['../components/userInfo/userInfo.vue'], resolve))
  },
  {
    path: '/userModify',
    // component: userModify
    component: resolve => void (require(['../components/userModify/userModify.vue'], resolve))
  },
  {
    path: '/modifyPWD',
    // component: userModify
    component: resolve => void (require(['../components/userModify/modifyPWD.vue'], resolve))
  },
  {
    path: '/calendar',
    // component: calendar
    component: resolve => void (require(['../components/calendar/calendar.vue'], resolve))
  },
  {
    path: '/orderDetail',
    // component: calendar
    component: resolve => void (require(['../components/allorders/orderDetail.vue'], resolve))
  },
  {
    path: '/cityPicker',
    // component: calendar
    component: resolve => void (require(['../components/cityPicker/cityPicker.vue'], resolve))
  },
  {
    path: '/addValue',
    // component: calendar
    component: resolve => void (require(['../components/addValue/addValue.vue'], resolve))
  },
  {
    path: '/selFoods',
    // component: calendar
    component: resolve => void (require(['../components/addValue/selFoods.vue'], resolve))
  },
  {
    path: '/confirmOrder',
    // component: calendar
    component: resolve => void (require(['../components/confirmOrder/confirmOrder.vue'], resolve))
  },
  {
    path: '/allOrders',
    // component: calendar
    component: resolve => void (require(['../components/allorders/allorders.vue'], resolve)),
    children: [
      {
        path: '/allOrders/allOrderList', // 全部
        mate: {keepAlive: true},
        component: resolve => void (require(['../components/allorders/allOrdersList.vue'], resolve))
      },
      {
        path: '/allOrders/nopayList', // 待支付
        mate: {keepAlive: true},
        component: resolve => void (require(['../components/allorders/nopayList.vue'], resolve))
      },
      {
        path: '/allOrders/payList', // 已支付
        mate: {keepAlive: true},
        component: resolve => void (require(['../components/allorders/payList.vue'], resolve))
      },
      {
        path: '/allOrders/finishList', // 已出票
        mate: {keepAlive: true},
        component: resolve => void (require(['../components/allorders/finishList.vue'], resolve))
      },
      {
        path: '/allOrders/cancelList', // 已取消
        mate: {keepAlive: true},
        component: resolve => void (require(['../components/allorders/cancelList.vue'], resolve))
      }
    ]
  },
  {
    path: '/airDynamic',
    // component: 航班动态
    component: resolve => void (require(['../components/airDynamic/airDynamic.vue'], resolve))
  },
  {
    path: '/airDynamicDetail',
    // component: 航班动态详情
    component: resolve => void (require(['../components/airDynamic/airDynamicDetail.vue'], resolve))
  },
  {
    path: '/airDynamic_findjg',
    // component: 航班详情
    component: resolve => void (require(['../components/airDynamic/airDynamic_findjg.vue'], resolve))
  },
  {
    path: '/passengers',
    // component: 乘机人管理页
    component: resolve => void (require(['../components/passengers/passengers.vue'], resolve))
  },
  {
    path: '/addPassenger',
    // component: 添加乘机人管理页
    component: resolve => void (require(['../components/passengers/addPassenger.vue'], resolve))
  },
  {
    path: '/addPassenger_wai',
    // component: 添加乘机人(国外)管理页
    component: resolve => void (require(['../components/passengers/addPassenger_wai.vue'], resolve))
  },
  {
    path: '/helpCenter',
    // component: 帮助中心
    component: resolve => void (require(['../components/helpCenter/helpCenter.vue'], resolve))
  },
  {
    path: '/helpCenterList',
    // component: 帮助中心条款
    component: resolve => void (require(['../components/helpCenter/helpCenterList.vue'], resolve))
  },
  {
    path: '/helpCenterDetail',
    // component: 帮助中心条款详情
    component: resolve => void (require(['../components/helpCenter/helpCenterDetail.vue'], resolve))
  },
  {
    path: '/newsDetail',
    // component: 新闻详情
    component: resolve => void (require(['../components/helpCenter/newsDetail.vue'], resolve))
  },
  {
    path: '/orderPayment',
    // component: 支付订单
    component: resolve => void (require(['../components/confirmOrder/orderPayment.vue'], resolve))
  },
  {
    path: '/index',
    // component: 首页
    component: resolve => void (require(['../components/index/index.vue'], resolve))
  },
  {
    path: '/bannerDetail',
    // component: 轮播详情
    component: resolve => void (require(['../components/index/bannerDetail.vue'], resolve))
  },
  {
    path: '/recommend',
    // component: 推荐航线
    component: resolve => void (require(['../components/recommend/recommend.vue'], resolve))
  },
  {
    path: '/xingliyuding',
    // component: 行李预订
    component: resolve => void (require(['../components/xingliyuding/xingliyuding.vue'], resolve))
  },
  {
    path: '/Reservation',
    // component: 行李预订选择服务页面
    component: resolve => void (require(['../components/xingliyuding/Reservation.vue'], resolve))
  },
  {
    path: '/ApplyRefund',
    // component: 退票页面
    component: resolve => void (require(['../components/refund/refundApply.vue'], resolve))
  },
  {
    path: '/ApplyCheck',
    // component: 退票页面
    component: resolve => void (require(['../components/refund/ApplyCheck.vue'], resolve))
  },
  {
    path: '/exit_fail',
    // component: 退票失败
    component: resolve => void (require(['../components/refund/exit_fail.vue'], resolve))
  },
  {
    path: '/ApplyViceCamp',
    // component: 退订增值服务
    component: resolve => void (require(['../components/refund/ApplyViceCamp.vue'], resolve))
  },
  {
    path: '/exit_success',
    // component: 退票成功
    component: resolve => void (require(['../components/refund/exit_success.vue'], resolve))
  }
];
Vue.use(Router);
export default new Router({
  routes: router
});
